<extend name="Public/common" />
<block name="content">
<div class="row">
	<div class="col-md-10 col-md-offset-1 m-b-md m-t-md">
		<div class="panel panel-default">
			<div class="panel-heading">
				<ul class="nav nav-tabs">
	            	<li class="active"><a data-toggle="tab" href="#settings">音乐分享</a></li>
	       		</ul>
	        </div>
	        <div class="panel-body"> 
	        	<div class="tab-pane fade active in" id="up">      					 		      				
                    <h4 class="no-margin skin-color ">上传音乐</h4>
                    <hr>
                    <form  class="bs-example form-horizontal"  action="" method="post">                    	
                        <div class="form-group">
                       		<label class="col-lg-2 control-label">音乐名称</label>
                        	<div class="col-lg-3">
								<input type="text" name="song" value="" class="form-control">
								<span class="help-block m-b-none">合理的名字审核才会通过</span>										
							</div>								                           
                        </div>
    
                        <div class="form-group">
                            <label class="col-lg-2 control-label">音乐类型</label>                                
                            <div class="col-lg-3">
                                <select class="form-control" name="genre">
								<volist name="genreList" id="vo">
	                          	<option value="<{$vo.id}>"><{$vo.title_show}></option>
	                            </volist>
                                </select>
                            </div>
                        </div>
                    	<div class="form-group">
                            <label class="col-lg-2 control-label">下载分值</label>
                            <div class="col-lg-2">
                                <select class="form-control" name = "score">
                                    <option value="0">免费</option>
                                    <option value="10">10</option>
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option value="40">40</option>
                                    <option value="50">50</option>
                                </select>
                            </div>
                        </div>
                                                
                    	<div class="form-group">
                        	<label class="col-lg-2 control-label">开始上传</label>
                            <div class="col-lg-5" >
                            	<input type="text" id="surl"  placeholder="" class="form-control" value="">	                                
                            </div>
                            <div class="col-lg-2">
                            	<input type="file" id="upload-btn">
                            </div>
                    	</div>
                    	<div class="form-group">
                    		<label class="col-lg-2 control-label">上传进度</label>
                    		<div class="col-lg-6 " style="height: 38px; background:#f5f5f5;">
                    			<div id="fileQueue" ></div>
                    		</div>
                        </div>
						
						
                   		<div class="form-group">
                            
                            <label class="col-lg-2 control-label">审核说明</label>
                            <div class="col-lg-6">
                                <textarea class="form-control" name="signature" rows="4" placeholder="请填写所分享音乐的简单介绍"></textarea>
                            </div>
                        </div>
                        
                        <div class="form-group">
                        	<input type="text" class="btn btn-default hide" name="listen_file_id" value="">
                        	<input type="text" class="btn btn-default hide" name="url" value="">
                        	<label class="col-lg-2 control-label"></label>
                        	<div class="col-lg-6">
                            <input type="submit" class="ajax-post-from btn btn-primary" value="保存" >
                        	</div>
                        </div>
                    </form>    					
      			</div>
	   		</div>
		</div>
	</div>
</div>
</block>
<block name="script">
 	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
	<script type="text/javascript">
	$("#upload-btn").uploadify({
		"height"          : 34,
		"swf"             : '__STATIC__/uploadify/uploadify.swf',
		"fileObjName"     : "user_file",
		"buttonText"      : "<i class='fa fa-cloud-upload text'></i>点击上传文件",
		"uploader"        : '<{:U('File/upload',array('session_id'=>session_id()))}>',
		"width"           : 100,
		'sizeLimit'		  :<{:C('USER_UPMUSIC_MAX')}>,
		'removeTimeout'	  : 1,
		'queueID': 'fileQueue',
		'fileTypeExts'	  : '*.mp3',
		"onUploadSuccess" : function (file, data){		
			var data = $.parseJSON(data);
			if(data.status){
				var src = data.url || JYMUSIC.ROOT + data.path;
				$("input[name='listen_file_id']").val(data.id);
				$('#surl').val('上传成功，地址已经保存！').off();
				$("input[name='url']").val(src);				
			} else {    				
				infoAlert(data.info,'',5000);    				
			}

		}
	});
	</script>

</block>